<?php #//v.3.3.0
#///////////////////////////////////////////////////////
#//  COPYRIGHT 2004 Phpauction.org ALL RIGHTS RESERVED//
#///////////////////////////////////////////////////////

require('../includes/config.inc.php');
include "loggedin.inc.php";
unset($ERR);

#//
if($_POST[action] == "update" && phpa_securepost($_POST))
{
	if($_POST['auctions'] != 'y') $_POST['auctions'] = 'n';
	if($_POST['users'] != 'y') $_POST['users'] = 'n';
	if($_POST['online'] != 'y') $_POST['online'] = 'n';
	#// Update database
	$query = "update PHPAUCTIONXL_counterstoshow SET
				  auctions='".$_POST['auctions']."',
				  users='".$_POST['users']."',
				  online='".$_POST['online']."'";
	$res = @mysql_query($query);
	if(!$res)
	{
		print "Error: $query<BR>".mysql_error();
		exit;
	}
	else
	{
		$ERR = $MGS_2__0063;
	}
}
#//
$query = "SELECT * FROM PHPAUCTIONXL_counterstoshow";
$res = @mysql_query($query);
if(!$res)
{
	print "Error: $query<BR>".mysql_error();
	exit;
}
elseif(mysql_num_rows($res) > 0)
{
	$COUNTERSTOSHOW = mysql_fetch_array($res);
}

?>
<HTML>
<HEAD>
<link rel='stylesheet' type='text/css' href='style.css' />
<link href="css/main.css" rel="stylesheet" type="text/css">
</HEAD>
<body bgcolor="#FFFFFF" text="#000000" link="#0066FF" vlink="#666666" alink="#000066" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="titulo">
        <tr> 
          <td class="icono"><img src="images/pref_icon.gif" width="28" height="28"></td>
          <td class="breadcrumbs"><p><span><?=$MSG_25_0008?></span>&nbsp;&gt;&gt;&nbsp;<?=$MGS_2__0057?></p></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
    <tr> 
    <td align="center" valign="middle">
<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0 BGCOLOR="#FFFFFF">
<TR>
<TD align="center">
<BR>
<FORM NAME=conf ACTION=<?=$_SERVER['PHP_SELF']?> METHOD=POST>
	<TABLE WIDTH="95%" BORDER="0" CELLSPACING="0" CELLPADDING="0"  class="base"  style="border:1px solid #ccc;">
		<TR>
			<TD ALIGN=CENTER class=title>
				<p><? print $MGS_2__0057; ?></p>
			</TD>
		</TR>
		<TR>
			<TD>
				<TABLE WIDTH=100% CELLPADDING=0 cellspacing="0" >
				<?
				if($ERR != "")
				{
				 ?>
					<TR BGCOLOR=yellow>
					 <TD class=error COLSPAN="2">
					 <p><? print $ERR; ?></p>
					</TD>
					   </TR>
				   <?
				}
				?>
					<TR VALIGN="TOP">
					  <TD HEIGHT="31" class="line">&nbsp;</TD>
					  <TD HEIGHT="31" class="line">
					  <p><?=$MGS_2__0058;?></p>
					  </TD>
				  </TR>
					<TR VALIGN="TOP">
						<TD WIDTH=173 HEIGHT="31" class="line">
						<p class="blue">	<?=$MGS_2__0062;?></p>
						</TD>
						<TD HEIGHT="31" WIDTH="459" class="line">
							<INPUT NAME="auctions" TYPE="checkbox" ID="auctions" VALUE="y" <?if($COUNTERSTOSHOW['auctions'] == 'y') print " CHECKED";?>>
						  
						  <?=$MGS_2__0060;?>
						  <BR>
						  <INPUT NAME="users" TYPE="checkbox" ID="users" VALUE="y" <?if($COUNTERSTOSHOW['users'] == 'y') print " CHECKED"?>>
						  
						  <?=$MGS_2__0061;?>
						  <BR>
						  <INPUT NAME="online" TYPE="checkbox" ID="online" VALUE="y" <?if($COUNTERSTOSHOW['online'] == 'y') print " CHECKED"?>>
						  
						  <?=$MGS_2__0059;?>
						  </TD>
					</TR>

					<TR VALIGN="TOP">
						<TD COLSPAN="2" HEIGHT="7"><IMG SRC="../images/transparent.gif" WIDTH="1" HEIGHT="5"></TD>
					</TR>
					<TR>
						<TD WIDTH=173 class="gris">
							<INPUT TYPE="hidden" NAME="action" VALUE="update" /> <INPUT TYPE="hidden" NAME="security" VALUE="<?php echo $_SESSION['security'];?>" />
							<INPUT TYPE="hidden" NAME="id" VALUE="<?=$id?>">
						</TD>
						<TD WIDTH="459" class="gris">
							<INPUT TYPE="submit" NAME="act" VALUE="<? print $MSG_530; ?>" class="action">
						</TD>
					</TR>
					<TR>
						<TD WIDTH=173></TD>
						<TD WIDTH="459"> </TD>
					</TR>
				</TABLE>
			</TD>
		</TR>
	</TABLE>
	</FORM>
</TD>
</TR>
</TABLE>

<!-- Closing external table (header.php) -->
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>